1 00:00:00,480 --> 00:00:01,190 Hello there. 2 00:00:01,200 --> 00:00:08,250 Welcome to this javascript comments video indeed feed your I will explain what jabba's group comments 3 00:00:08,400 --> 00:00:14,860 does and also provide an example of the two types of javascript comments. 4 00:00:14,880 --> 00:00:19,060 So what is javascript comments are what are Jabr script comments. 5 00:00:19,110 --> 00:00:25,650 What javascript comments are used to explain parts of a code of a javascript code. 6 00:00:25,920 --> 00:00:29,270 So is a good practice to have comments in your code. 7 00:00:29,330 --> 00:00:32,630 Course this will help you down the road later. 8 00:00:32,850 --> 00:00:36,360 Why are you not sure what parts of the code does. 9 00:00:36,380 --> 00:00:38,380 BALDWIN There are comments in the court. 10 00:00:38,400 --> 00:00:42,650 He will guide you or remind you us to what those block are. 11 00:00:42,660 --> 00:00:45,260 Parts of the code does it. 12 00:00:45,370 --> 00:00:49,420 Oz saw is a good practice because you may have in future. 13 00:00:49,470 --> 00:00:53,090 Others may want to look at the code you you've written. 14 00:00:53,220 --> 00:00:59,510 If there are comments on them it will help them understand the code better. 15 00:00:59,760 --> 00:01:05,500 Javascript commands can also use usses candle testin or troubleshooting tool. 16 00:01:05,730 --> 00:01:13,890 So if you are no test set in part of the code and you don't want set parts to to execute or run you 17 00:01:13,890 --> 00:01:20,410 can use comments to block out that those parts of the code and them test the other parts. 18 00:01:20,430 --> 00:01:25,890 Those are some of the ways you can use javascript comments and there are two main types of javascript 19 00:01:25,890 --> 00:01:29,290 comments you got the single line comments. 20 00:01:29,400 --> 00:01:36,000 Wade appears just on the single line of the of the court and they go on multiple like comet which will 21 00:01:36,030 --> 00:01:38,240 comment out a block of code. 22 00:01:38,300 --> 00:01:44,280 Someone's going to show you couple of example one of this single line comment and one on the multiple 23 00:01:44,280 --> 00:01:46,960 line comments. 24 00:01:47,070 --> 00:01:53,010 All right this is the simple web page I created in the previous videos. 25 00:01:53,110 --> 00:02:01,410 I've been working with some When I used to be because the hasty email caught on this web page to illustrate 26 00:02:01,410 --> 00:02:05,620 how javascript comments work right. 27 00:02:05,650 --> 00:02:13,760 I'll start with a single line comment if single line comments are place on the right side on the code. 28 00:02:13,780 --> 00:02:20,220 Then each will comment had all the cord or parts of the court and that part will not be displayed when 29 00:02:20,220 --> 00:02:21,460 the browser loads. 30 00:02:21,600 --> 00:02:23,910 So start with a single line comment only. 31 00:02:23,910 --> 00:02:27,350 Done using two slashes. 32 00:02:27,780 --> 00:02:29,290 That's why you need two slashes. 33 00:02:29,290 --> 00:02:33,530 And his comment about orval are this line of could sway. 34 00:02:33,530 --> 00:02:42,820 I say that and run this page you'll only get this part of the javascript tape and display coalesced 35 00:02:42,870 --> 00:02:47,300 to let the run launch in Chrome. 36 00:02:47,370 --> 00:02:53,280 A gun was loaded it page content and then this part of the javascript which is the second part of the 37 00:02:53,280 --> 00:03:00,460 code right says exit that arise for is. 38 00:03:01,070 --> 00:03:03,960 Ignore that and display that. 39 00:03:03,960 --> 00:03:07,930 So what if I want Bull's code excluded. 40 00:03:07,950 --> 00:03:16,610 I don't want any javascript to load on this page at all so I'll do that using a multiple line comment. 41 00:03:16,620 --> 00:03:21,990 You do that with a slash an asterix 42 00:03:26,010 --> 00:03:31,150 And then as serax then a slash 43 00:03:33,930 --> 00:03:36,480 symbol. 44 00:03:38,130 --> 00:03:39,600 All right. 45 00:03:39,610 --> 00:03:51,330 So anything in between the Asterix will not be displayed by the browser so should cause have been commented 46 00:03:51,330 --> 00:03:51,730 out. 47 00:03:51,750 --> 00:03:59,100 So the browser will display no javascript on this piece of board jabb Us group soup statements on this 48 00:03:59,100 --> 00:04:01,400 page will be ignored by the browser. 49 00:04:01,440 --> 00:04:03,660 Because of this mortar pull line comment. 50 00:04:03,690 --> 00:04:07,470 So I saved that and run that in Chrome. 51 00:04:07,470 --> 00:04:09,100 There should be no javascript. 52 00:04:09,100 --> 00:04:13,780 You see that is just low that the page content without any javascript at all. 53 00:04:13,950 --> 00:04:20,560 So this is how you would write a multiple line comments. 54 00:04:20,560 --> 00:04:28,200 He can also play single line comments on the right hand side of the court so if single line comments 55 00:04:28,200 --> 00:04:32,690 are placed on the right side the chord will still run. 56 00:04:32,730 --> 00:04:39,710 But the comment itself will not be displayed so let's put a single line comment here doubles laughs. 57 00:04:39,950 --> 00:04:43,020 Just explain what that part of the code does. 58 00:04:53,370 --> 00:05:02,220 All right Sovs expend this battle because by saying these walls show an alleged box so I'll comment 59 00:05:02,220 --> 00:05:07,980 out this one so that we can see the effect more on the first one. 60 00:05:08,250 --> 00:05:13,770 So the first part will display because a comment is on the right second part. 61 00:05:13,780 --> 00:05:18,070 Well not because the comment is on the left. 62 00:05:18,210 --> 00:05:21,390 Our quick run luncheon Crow. 63 00:05:22,350 --> 00:05:23,940 They got the that's the first part. 64 00:05:23,940 --> 00:05:27,570 Show me the money and that's the content. 65 00:05:28,960 --> 00:05:38,040 Okay so this part of this play is part dead and so if this scripted single line comments are left be 66 00:05:38,130 --> 00:05:41,260 called will not execute Fice on the right. 67 00:05:41,440 --> 00:05:43,370 The code will display. 68 00:05:43,680 --> 00:05:52,160 So this is an example of multiple and single line comments in this video. 69 00:05:52,160 --> 00:05:58,380 I have explained what Jav as quick comment dance and the benefits of using javascript comments. 70 00:05:58,500 --> 00:06:06,060 I showed an example of his single line comments and the multiple line comment also showed the effect 71 00:06:06,120 --> 00:06:13,790 of placing a single line comment on the right hand side of the jabaar scroop coat when this is done. 72 00:06:13,800 --> 00:06:18,730 He will give a description on the code and the code will still run. 73 00:06:19,050 --> 00:06:21,400 I hope the video as being useful. 74 00:06:21,410 --> 00:06:27,160 You can practice inserting comments inside that same CML coat. 75 00:06:27,510 --> 00:06:29,150 Thank you so much for watching. 76 00:06:29,160 --> 00:06:30,340 Bye for now.